#pragma once
#include <cocos2d.h>
#include "pugixml.hpp"
#include "PlayerPlane.h"
#include "ObjectDataDefine.h"

using namespace pugi;
USING_NS_CC;

class PlaneFactory : public CCObject
{
public:
	PlaneFactory(void);
	~PlaneFactory(void);

	virtual bool init();
	virtual void parseXml(xml_node node);
	virtual PlayerPlane* createPlaneByType(char* type);

	/**
	Level start at 0
	*/
	PlayerPlane* createPlaneByLevel(int level);

	PlaneData* getPlaneDataByLevel(int level);

	int getPriceAtLevel(int level);

	CC_SYNTHESIZE_RETAIN(CCString*, _id, Id);
	CC_SYNTHESIZE_RETAIN(CCString*, _ai, Ai);
	//CC_SYNTHESIZE_RETAIN(CCArray*, _listWeapon, Weapons);
	CC_SYNTHESIZE_RETAIN(CCArray*, _listLevel, Levels);
	CC_SYNTHESIZE_RETAIN(CCArray*, _listType, Types);
	CREATE_FUNC(PlaneFactory);
};

